const testModule = (function () {
    let counter = 0;
    return {
        increment: function () {
            counter++;
        },
        reset: function () {
            counter = 0;
        },
        getCount: function () {
            return counter;
        }
    }
})();

function main() {
    console.log(testModule.getCount());
    for (let i = 0; i < 3; i++) {
        testModule.increment();
    }
    console.log(testModule.getCount());
    testModule.reset();
    console.log(testModule.getCount());
}

main();
